<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link rel="stylesheet" href="../plugins/elementui/index.css">

    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">

    <link rel="stylesheet" href="../css/style.css">
    <style>
        html {
            height: 100%;
            width: 100%;
            overflow: hidden;
            margin: 0;
            padding: 0;
            /*background: url("../image/img_1.png") no-repeat 0px 0px;*/
            background-size: 100% 100%;
            -moz-background-size: 100% 100%;
        }
    </style>
</head>
<style scoped>

    .login-box {
        border: 1px solid #DCDFE6;
        width: 350px;
        margin: 180px auto;
        padding: 35px 35px 15px 35px;
        border-radius: 5px;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        box-shadow: 0 0 25px #909399;
    }

    .login-title {
        text-align: center;
        margin: 0 auto 40px auto;
        color: #303133;
    }
</style>
<body>

<div id="app">
    <el-form ref="loginForm" :model="form"  label-width="80px" class="login-box">
        <h3 class="login-title">操作员登录</h3>

        <el-row>

            <el-col :span="24">

                <el-form-item label="姓名">

                    <el-input v-model="form.name" type="text" placeholder="请输入姓名"></el-input>

                </el-form-item>

            </el-col>

        </el-row>

        <el-row>

            <el-col :span="24">

                <el-form-item label="身份证号">

                    <el-input v-model="form.identity" type="password" placeholder="请输入身份证号"></el-input>

                </el-form-item>

            </el-col>

        </el-row>




        <el-form-item>
            <el-button type="primary" @click="onSubmit()">登录</el-button>
        </el-form-item>
    </el-form>

</div>

</body>

<script src="../js/vue.js"></script>

<script src="../plugins/elementui/index.js"></script>

<script type="text/javascript" src="../js/jquery.min.js"></script>

<script src="../js/axios-0.18.0.js"></script>


<script>
    var vue=new Vue({
        el:'#app',
        data() {
            return {
                form: {
                    name: '',
                    identity: ''
                },
                dataList:[]
            }
        },
        methods: {
            onSubmit(){
                axios.post("http://localhost:8080/operators/login",this.form).then((res)=>{
                    console.log(res.data);
                    if(res.data.code == 20011){
                        window.location.href="http://localhost:8080/pages/Account.html?id="+res.data.data
                    }else if(res.data.code ==40010){
                        this.$message.error("登入失败,账号或密码错误");
                    }
                });
            }
        }
    })
</script>


</html>